package homework;

import org.junit.Test;

public class TestMethod02 {
   @Test
    public void test01() {

            buyChicken();
        }
        public void buyChicken () {
            for (int cock = 0; cock <= 20; cock++) {
                for (int hen = 0; hen <= 33; hen++) {
                    int chick = 100 - cock - hen;
                    if (chick > 0 && chick % 3 == 0) {
                        int totalCost = 5 * cock + 3 * hen + chick / 3;
                        if (totalCost == 100) {
                            System.out.println("公鸡:" + cock + "只 母鸡:" + hen + "只 小鸡:" + chick + "只");
                        }
                    }
                }
            }
        }
    }



